package com.drug.mingkang.controller;

import com.drug.mingkang.model.vo.MaterialInventoryDetailVo;
import com.drug.mingkang.service.HqWarehousingService;
import com.drug.mingkang.utils.Tools;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * 总公司库存明细(HqWarehousing)表控制层
 *
 * @author wenchangjian
 * @since 2020-08-11 12:00:13
 */
@RestController
@RequestMapping("hqWarehousing")
@Api(value = "总公司库存明细控制层", tags = "总公司库存明细Contorller")
public class HqWarehousingController {
    /**
     * 服务对象
     */
    @Resource
    private HqWarehousingService hqWarehousingService;
    @Resource
    private Tools tools;

    /**
     * 根据库存id 查询库存明细
     * @param vo 库存参数
     * @return 库存明细列表
     */
    @ApiOperation(value = "根据库存id 查询库存明细", notes = "根据库存id 查询库存明细", httpMethod = "POST", response = Map.class)
    @PostMapping("showAll")
    public Map<String, Object> showAll(MaterialInventoryDetailVo vo) {
        List<MaterialInventoryDetailVo> list = hqWarehousingService.selectMaterialInventoryDetailAll(vo);
        int count = hqWarehousingService.selectMaterialInventoryDetailCount(vo);
        return tools.limit(list, count);
    }

}